import request from '@/utils/request'
import da from "element-ui/src/locale/lang/da";

// 查询商品信息列表
export function listProducts(query) {
  return request({
    url: '/ds/product/storeList',
    method: 'get',
    params: query
  })
}

// 查询商品信息详细
export function getProducts(id) {
  return request({
    url: '/ds/product/' + id,
    method: 'get'
  })
}

// 新增商品信息
export function addProducts(data) {
  return request({
    url: '/ds/product',
    method: 'post',
    data: data
  })
}

// 修改商品信息
export function updateProducts(data) {
  console.log('data:',data);
  return request({
    url: '/ds/product',
    method: 'put',
    data: data
  })
}

// 删除商品信息
export function delProducts(id) {
  return request({
    url: '/ds/product/' + id,
    method: 'delete'
  })
}

// 导出商品信息
export function exportProducts(query) {
  return request({
    url: '/ds/product/export',
    method: 'get',
    params: query
  })
}

// 商品规格sku
export function specification(query) {
  return request({
    url: '/ds/specification/list',
    method: 'get',
    params: query
  })
}
// 获取规格列表
export function keyList(query) {
  return request({
    url: '/ds/key/list',
    method: 'get',
    params: query
  })
}
// 获取规格列表
export function valueList(query) {
  return request({
    url: '/ds/value/list',
    method: 'get',
    params: query
  })
}
